{{:ModuleInclude('public/header')}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('admin/goodsparamstemplate/save')}}" method="POST" request-type="ajax-reload" request-value="parent">
			
            <div class="am-form-group row">
                <label>{{:MyLang('common_service.goodsparamstemplate.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="name" placeholder="{{:MyLang('common_service.goodsparamstemplate.form_item_name_message')}}" minlength="1" maxlength="80" data-validation-message="{{:MyLang('common_service.goodsparamstemplate.form_item_name_message')}}" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
            </div>
            <div class="am-form-group row">
                <label class="am-block">
                    {{:MyLang('common_service.goodsparamstemplate.form_item_category_id')}}
                    <span class="am-form-group-label-tips-must">*</span>
                    <a href="javascript:;" class="am-icon-question-circle am-margin-left-xs" data-am-popover="{content: '{{:MyLang('common_service.goodsparamstemplate.form_item_category_id_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a>
                </label>
                <select name="category_id" class="am-radius chosen-select" data-placeholder="{{:MyLang('please_select_tips')}}" data-validation-message="{{:MyLang('common_service.goodsparamstemplate.form_item_category_id_message')}}" required>
                    {{if !empty($goods_category_list)}}
                        <option value="">{{:MyLang('please_select_tips')}}</option>
                        {{foreach $goods_category_list as $v}}
                            <option value="{{$v.id}}" {{if isset($data['category_id']) and $data['category_id'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                        {{/foreach}}
                    {{/if}}
                </select>
            </div>
            {{:ModuleInclude('lib/is_enable', ['is_row'=>1])}}

			<div class="am-form-group row">
                <label class="am-block">
                    {{:MyLang('common_service.goodsparamstemplate.form_item_config_title')}}
                    <span class="am-form-group-label-tips-must">*</span>
                    <a href="javascript:;" class="am-icon-question-circle am-margin-left-xs" data-am-popover="{content: '{{:MyLang('common_service.goodsparamstemplate.form_item_config_list_content_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a>
                </label>
                <div>
                    <!-- 通过配置生成商品参数 -->
                    <div class="am-dropdown" id="parameters-quick-container" data-am-dropdown>
                        <span class="business-operations-submit am-dropdown-toggle parameters-quick-add">
                            <span>{{:MyLang('common_service.goodsparamstemplate.form_item_config_template_title')}}</span>
                            <i class="am-icon-angle-down"></i>
                        </span>
                        <div class="am-dropdown-content parameters-quick-config">
                            <textarea rows="5" placeholder="{{:MyLang('common_service.goodsparamstemplate.form_item_config_value_placeholder')}}"></textarea>
                            <button type="button" class="am-btn am-btn-primary am-btn-xs am-radius am-btn-block am-margin-top-sm">{{:MyLang('confirm_title')}}</button>
                        </div>
                    </div>
                    <!-- 复制操作 -->
                    <span class="business-operations-submit am-margin-left-sm parameters-quick-copy">
                        <i class="am-icon-copy"></i>
                        <span>{{:MyLang('common_service.goodsparamstemplate.form_item_config_copy_title')}}</span>
                    </span>
                    <!-- 清空操作 -->
                    <span class="business-operations-submit am-margin-left-sm parameters-quick-remove">
                        <i class="am-icon-times"></i>
                        <span>{{:MyLang('common_service.goodsparamstemplate.form_item_config_empty_title')}}</span>
                    </span>
                </div>
			</div>
            <div class="am-form-group">
                <div>
                    {{:ModuleInclude('public/goodsparamstemplate/table')}}
                </div>
                {{:ModuleInclude('public/goodsparamstemplate/tips')}}
            </div>
			<!-- 插件扩展数据 start -->
			{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_admin_goods_params_template_save</span>
                </div>
            {{/if}}
			{{if !empty($plugins_view_admin_goods_params_template_save_data) and is_array($plugins_view_admin_goods_params_template_save_data)}}
				<div class="am-alert am-alert-secondary">
					<label class="am-text-sm am-text-warning">{{:MyLang('plugins_view_region_config_tips')}}</label>
					<div>
						{{foreach $plugins_view_admin_goods_params_template_save_data as $hook}}
		                    {{if is_string($hook) or is_int($hook)}}
		                        {{$hook|raw}}
		                    {{/if}}
		                {{/foreach}}
					</div>
				</div>
			{{/if}}
			<!-- 插件扩展数据 end -->

			<div class="am-form-popup-submit">
				<input type="hidden" name="id" {{if !empty($data['id'])}} value="{{$data.id}}"{{/if}} />
				<button type="button" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg" data-am-modal-close>
                    <i class="am-icon-paint-brush"></i>
                    <span>{{:MyLang('cancel_title')}}</span>
                </button>
                <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                    <i class="am-icon-save"></i>
                    <span>{{:MyLang('save_title')}}</span>
                </button>
			</div>
		</form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{:ModuleInclude('public/footer')}}